package com.mui.controls
{
	import com.mui.manager.*;
	import com.mui.skins.*;
	import fl.controls.*;
	import fl.core.*;
	import flash.events.*;
	
	public class GButton extends Button implements IToolTipItem
	{
		public const CLASSNAME:String = "Button";
		protected var _toolTipData:Object;
		protected var _styleName:String;
		protected var _isStyleChange:Boolean = false;
		
		public function GButton()
		{
			this.buttonMode = true;
			this.useHandCursor = true;
			this.focusEnabled = false;
			
		}
		
		override protected function keyDownHandler(event:KeyboardEvent) : void
		{
			
		}
		
		override protected function keyUpHandler(event:KeyboardEvent) : void
		{
			
		}
		
		public function get toolTipData() : *
		{
			return this._toolTipData;
		}
		
		public function set toolTipData(param1:*) : void
		{
			if (param1 == null || param1 == "")
			{
				ToolTipsManager.unregister(this);
			}
			else
			{
				ToolTipsManager.register(this);
			}
			this._toolTipData = param1;
			
		}
		
		final override protected function configUI() : void
		{
			super.configUI();
			this.createChildren();
			
		}
		
		public function get styleName() : String
		{
			return this._styleName;
		}
		
		public function set styleName(param1:String) : void
		{
			if (this._styleName != param1)
			{
				this._styleName = param1;
				invalidate(InvalidationType.STYLES);
				this._isStyleChange = true;
			}
			
		}
		
		final override protected function draw() : void
		{
			if (isInvalid(InvalidationType.STYLES))
			{
				if (this._isStyleChange)
				{
					SkinManager.setComponentStyle(this, this._styleName);
					this._isStyleChange = false;
				}
				this.updateStyle();
			}
			if (isInvalid(InvalidationType.DATA))
			{
				this.updateDate();
			}
			if (isInvalid(InvalidationType.SIZE))
			{
				this.updateSize();
			}
			if (isInvalid(InvalidationType.SIZE, InvalidationType.SELECTED, InvalidationType.DATA))
			{
				this.updateDisplayList();
			}
			try
			{
				super.draw();
			}
			catch (e:Error)
			{
			}
			
		}
		
		protected function createChildren() : void
		{
			
		}
		
		protected function updateStyle() : void
		{
			
		}
		
		protected function updateSize() : void
		{
			
		}
		
		protected function updateDate() : void
		{
			
		}
		
		protected function updateDisplayList() : void
		{
			
		}
		
	}
}
